package models

import (
	"github.com/astaxie/beego/orm"
	_"github.com/go-sql-driver/mysql"
	)

//表的设计
type Users struct {
	Id int
	Username string
	Pwd string
	UserId int
	AddTime string
}

func init() {
	//设置数据库基本信息
	orm.RegisterDataBase("default","mysql","root:8880811Ycc@tcp(127.0.0.1:3306)/gobd?charset=utf8")
	//映射model数据
	orm.RegisterModel(new(Users))	//orm.RegisterModel(new(User),new(User1)...) 
	//生成表
	orm.RunSyncdb("default",false,true)
}